package controllers;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import models.UserModel;

import data.UserData;

public class PreviewEmailForgetServlet extends HttpServlet{
	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException {
		
		String email = (String) request.getParameter("email");
		UserData userData = new UserData();
		UserModel user =  userData.getUser(email);
		
		
		request.setAttribute("user", user);
		try {
			request.getRequestDispatcher("/pages/preview_mail_forget_password.jsp").forward(request, response);
		} catch (ServletException e) {
			//e.printStackTrace();
		}
	}
}
